Fix sfp test's starting index#4099
Fix sfp test's starting index#4099prgeor merged 4 commits intosonic-net:masterfrom prgeor:sfp_index_fix
Conversation
|
This pull request introduces 1 alert when merging 1c9260d into fe644b8 - view on LGTM.com new alerts:
|
|
@rawal01 can you review? |
|
@prgeor this because your list_sfps will be just a subset of all interfaces while platform.json from which it is comparing always has all interface sfp names. |
Signed-off-by: Prince George <prgeor@microsoft.com>
@rawal01 I have addressed your comment. can you check and approve? |
|
This pull request introduces 4 alerts when merging 5b12f54 into 8ecfc14 - view on LGTM.com new alerts:
|
|
@prgeor Thank you for changes it resolves the one case I mentioned and also taking care of test_chassis. I would like suggest some changes also in both test_chassis.py and test_sfp.py we do not to define physical_pot_indices any more seems uneccessary I think it is simpler to assign lit directly |
Signed-off-by: Prince George <prgeor@microsoft.com>
@rawal01 It will be easier if you can comment against the file/line number. I have made the changes and fixed LGTM warnings. get_physical_port_indices() is a time consuming function and hence i have wrapped around it in a pytest fixture with module scope. |
|
@yxieca could you review |
|
@prgeor Yes makes sense the changes look good to me |
Signed-off-by: Prince George <prgeor@microsoft.com>
* Fix sfp test's starting index * Addressed review comments Signed-off-by: Prince George <prgeor@microsoft.com> * Fix LGTM warnings Signed-off-by: Prince George <prgeor@microsoft.com> * Use sonic-db-cli Signed-off-by: Prince George <prgeor@microsoft.com>
Description of PR
The current platform API tests for SFP uses indices starting from 0 which fails to return the correct SFP object for platforms having physical port number starting from 1. This is because get_port_map() -> config_facts.create_map() always creates the map with starting index 0.
Summary:
Fixes # (issue)
Type of change
Back port request
Approach
What is the motivation for this PR?
Fix issues #8435, #8436 buildimage repo
How did you do it?
To fix, this we now first find all Ethernet ports in the DUT and use redis-cli to get the corresponding 'index' (physical port number). from config DB. This should work for breakout ports and multi-asic as well.
How did you verify/test it?
Ran all tests under test_sfp.py on Arista 7050CX3
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation